//
//  LGMedicineBallScreenCell.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/8/22.
//

#import "LGMedicineBallScreenCell.h"

@interface LGMedicineBallScreenCell()

/**   */
@property (nonatomic , strong)UIButton *itemButton;

@end

@implementation LGMedicineBallScreenCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self.contentView addSubview:self.itemButton];
        [self.itemButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.centerY.equalTo(self.contentView);
            make.height.equalTo(@(viewPix(32)));
        }];
    }
    return self;
}

-(void)setContent:(NSString *)content{
    _content = content;
    [self.itemButton setTitle:content forState:UIControlStateNormal];
}

-(void)setIsSelect:(BOOL)isSelect{
    _isSelect = isSelect;
    self.itemButton.selected = isSelect;
}

-(UIButton *)itemButton{
    if(!_itemButton){
        _itemButton = [UIButton buttonWithTitle:@"" titleFont:LGFontWeight(15, UIFontWeightMedium) normalColor:@"#666666" selectColor:@"#FFFFFF"];
        [_itemButton setBackgroundColor:[UIColor colorWithString:@"#F6F6F6"] forState:UIControlStateNormal];
        [_itemButton setBackgroundColor:[UIColor colorWithString:kThemeColor] forState:UIControlStateSelected];
        _itemButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
        _itemButton.userInteractionEnabled = NO;
        _itemButton.cornerRidus = viewPix(16);
    }
    return _itemButton;
}

@end
